<?php /* Smarty version Smarty-3.1.6, created on 2013-04-07 10:20:28
         compiled from "/home/zmx/erp2.1/DzhPHP/FrameWork/Tpl/Product/edit.tpl" */ ?>
<?php /*%%SmartyHeaderCode:19540090665160d7ec813823-16412698%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'c7491c782c49dfcc37d7d66695ec87fa95184b17' => 
    array (
      0 => '/home/zmx/erp2.1/DzhPHP/FrameWork/Tpl/Product/edit.tpl',
      1 => 1364183645,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '19540090665160d7ec813823-16412698',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'rs' => 0,
    'file_tocken' => 0,
    'lang' => 0,
    'is_auto_no' => 0,
    'show_price_title' => 0,
    'show_field' => 0,
    'cur' => 0,
    'item' => 0,
    'key' => 0,
    'sid' => 0,
    'properties_name' => 0,
    'pv_name' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.6',
  'unifunc' => 'content_5160d7ecafba2',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5160d7ecafba2')) {function content_5160d7ecafba2($_smarty_tpl) {?><?php if (!is_callable('smarty_function_wz')) include '/home/zmx/erp2.1/DzhPHP/FrameWork/Extend/Vendor/Smarty/plugins/function.wz.php';
if (!is_callable('smarty_function_html_fit')) include '/home/zmx/erp2.1/DzhPHP/FrameWork/Extend/Vendor/Smarty/plugins/function.html_fit.php';
?><script>
<?php if ($_smarty_tpl->tpl_vars['rs']->value['product_class_id']){?>
$().ready(function(){
	getParentProductClass('',<?php echo $_smarty_tpl->tpl_vars['rs']->value['product_class_id'];?>
);
	sumBag();
})


function sumBag(){
	if($dom.find("#dozen").length<=0) return;
	var c = parseInt($dom.find("#capability").val());
	var d = parseInt($dom.find("#dozen").val()); 
	if(isNaN(c)) c = 0;
	if(isNaN(d)) d = 0;
	if(c/d=='Infinity'){
		$("#p_s_3").val('');
		return;
	}
	var bag = c/d;
	if(isNaN(bag) || bag==0) bag = '';  
	$dom.find("#p_s_3").val(bag);  
}
<?php }?>

<?php if (C('PRODUCT_COLOR')==1){?>
function checkColor(obj){
	if(obj.checked!=true){  
		$.get(APP+'/Ajax/checkProdcutColor/product/<?php echo $_smarty_tpl->tpl_vars['rs']->value['id'];?>
/color/'+obj.value,function(data){
			if(data>0){
				obj.checked = true;
				alert('存在未销售库存，修改失败！')
			}
		})
	}
}
<?php }?>
<?php if (C('PRODUCT_SIZE')==1){?>
function checkSize(obj){
	if(obj.checked!=true){ 
		$.get(APP+'/Ajax/checkProdcutSize/product/<?php echo $_smarty_tpl->tpl_vars['rs']->value['id'];?>
/size/'+obj.value,function(data){
			if(data>0){
				obj.checked = true;
				alert('存在未销售库存，修改失败！')
			}
		})
	}
}
<?php }?>
</script>
<form action="<?php echo U('Product/update');?>
" method="POST" name="Basic_addProductClass" onsubmit="return false">
<?php echo smarty_function_wz(array('action'=>"save,list,reset"),$_smarty_tpl);?>

  <input type="hidden" name="id" value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['id'];?>
">
  <input type="hidden" name="lock_version" id="lock_version" value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['lock_version'];?>
">
  <input type="hidden" name="file_tocken" value="<?php echo $_smarty_tpl->tpl_vars['file_tocken']->value;?>
">
<!--  <input type="hidden" name="orders_norms" value="<?php echo C("ORDERS_NORMS");?>
">-->
  <div class="add_box">
  <table cellspacing="0" cellpadding="0" class="add_table">
    <tbody>
    <tr><th colspan="2"><?php echo $_smarty_tpl->tpl_vars['lang']->value['basic_title'];?>
</th></tr>
    <tr>
      <td class="width15"><?php echo $_smarty_tpl->tpl_vars['lang']->value['product_no'];?>
：</td>
      <td class="t_left"><input type="text" name="product_no"  value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['product_no'];?>
" <?php echo $_smarty_tpl->tpl_vars['is_auto_no']->value;?>
 >__*__
      </td>
    </tr>
    <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['product_name'];?>
：</td>
      <td class="t_left"><input type="text" name="product_name" value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['product_name'];?>
" class="spc_input" >__*__
      </td>
    </tr>
     <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['class_name'];?>
：</td>
      <td class="t_left">
      <input type="hidden" name="product_class_id" id="product_class_id" value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['product_class_id'];?>
"><input id="product_class_name" value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['product_id_name'];?>
" url="<?php echo U('/AutoComplete/lastProductClass');?>
" jqac >__*__<span id="parent_info"></span></td>
    </tr>
    <?php if (C('PRODUCT_FACTORY')==1){?>    
    <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['factory_name'];?>
：</td>
      <td class="t_left"> 
      <input type="hidden" name="factory_id" id="factory_id" value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['factory_id'];?>
"> 
      <?php if ($_smarty_tpl->tpl_vars['rs']->value['factory_readonly']){?>
      <?php echo $_smarty_tpl->tpl_vars['rs']->value['factory_name'];?>

      <?php }else{ ?>
      <input id="factory_name" name="temp[factory_name]" value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['factory_name'];?>
" url="<?php echo U('/AutoComplete/factory');?>
" jqac>__*__
      <?php }?>
      </td>
    </tr>
    <?php }?>
    <?php if (C('PRODUCT_COLOR')==1){?>
    <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['color_name'];?>
：</td>
      <td class="t_left">
      <?php if (C('PRODUCT_COLOR')==1){?>
      <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['rs']->value['color'];?>
<?php $_tmp1=ob_get_clean();?><?php echo smarty_function_checkbox(array('onclick'=>"checkColor(this)",'table'=>"color",'key'=>"id",'field'=>"color_name",'name'=>"color[]",'where'=>"to_hide=1",'value'=>$_tmp1),$_smarty_tpl);?>

      <?php }else{ ?>
       <?php echo smarty_function_checkbox(array('table'=>"color",'key'=>"id",'field'=>"color_name",'name'=>"color[]",'where'=>"to_hide=1",'value'=>$_smarty_tpl->tpl_vars['rs']->value['color']),$_smarty_tpl);?>

      <?php }?>
    </td></tr>
    <?php }?>
    <?php if (C('PRODUCT_SIZE')==1){?>
    <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['size_name'];?>
：</td>
      <td class="t_left">
      <?php if (C('PRODUCT_SIZE')==1){?>
      <?php echo smarty_function_checkbox(array('onclick'=>"checkSize(this)",'table'=>"size",'key'=>"id",'field'=>"size_name",'name'=>"size[]",'where'=>"to_hide=1",'value'=>$_smarty_tpl->tpl_vars['rs']->value['size']),$_smarty_tpl);?>

      <?php }else{ ?>
      <?php echo smarty_function_checkbox(array('table'=>"size",'key'=>"id",'field'=>"size_name",'name'=>"size[]",'where'=>"to_hide=1",'value'=>$_smarty_tpl->tpl_vars['rs']->value['size']),$_smarty_tpl);?>

      <?php }?>
      </td>
    </tr>
    <?php }?>
     <?php if ($_smarty_tpl->tpl_vars['show_price_title']->value){?>
    <tr><th colspan="2"><?php echo $_smarty_tpl->tpl_vars['lang']->value['price_title'];?>
</th></tr>
    <?php }?>
     <?php if ($_smarty_tpl->tpl_vars['show_field']->value['instock_price']){?>
    <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['instock_price'];?>
：</td>
      <td class="t_left">
      <input type="text" name="instock_price" value="<?php echo dml($_smarty_tpl->tpl_vars['rs']->value['edml_instock_price']);?>
" class="spc_input">（<?php echo $_smarty_tpl->tpl_vars['cur']->value['in'];?>
）</td>
    </tr>
    <?php }?>
    <?php if (C('MULTI_CLIENT')){?>
     <?php if ($_smarty_tpl->tpl_vars['show_field']->value['wholesale_price']){?>
     <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['wholesale_price'];?>
：</td>
      <td class="t_left">
      <input type="text" name="wholesale_price" value="<?php echo dml($_smarty_tpl->tpl_vars['rs']->value['edml_wholesale_price']);?>
" class="spc_input">（<?php echo $_smarty_tpl->tpl_vars['cur']->value['out'];?>
）</td>
    </tr>
    <?php }?>
     <?php if ($_smarty_tpl->tpl_vars['show_field']->value['retail_price']){?>
     <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['retail_price'];?>
：</td>
      <td class="t_left">
      <input type="text" name="retail_price" value="<?php echo dml($_smarty_tpl->tpl_vars['rs']->value['edml_retail_price']);?>
" class="spc_input">（<?php echo $_smarty_tpl->tpl_vars['cur']->value['out'];?>
）</td>
    </tr>
    <?php }?>
     <?php if ($_smarty_tpl->tpl_vars['show_field']->value['sale_price']){?>
    <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['other_price'];?>
：</td>
      <td class="t_left">
      <input type="text" name="sale_price" value="<?php echo dml($_smarty_tpl->tpl_vars['rs']->value['edml_sale_price']);?>
" class="spc_input">（<?php echo $_smarty_tpl->tpl_vars['cur']->value['out'];?>
）</td>
    </tr>
   <?php }?>
    <?php }else{ ?>
     <?php if ($_smarty_tpl->tpl_vars['show_field']->value['sale_price']){?>
     <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['sale_price'];?>
：</td>
      <td class="t_left">
      <input type="text" name="sale_price" value="<?php echo dml($_smarty_tpl->tpl_vars['rs']->value['edml_sale_price']);?>
" class="spc_input">（<?php echo $_smarty_tpl->tpl_vars['cur']->value['out'];?>
）</td>
    </tr>
    <?php }?>
    <?php }?>
     <?php if ($_smarty_tpl->tpl_vars['show_field']->value['instock_price']){?>
   <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['avg_price'];?>
：</td>
      <td class="t_left">
      <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['rs']->value['price']['avg']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value){
$_smarty_tpl->tpl_vars['item']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
?>
      <?php if ($_smarty_tpl->tpl_vars['item']->value>0){?><?php echo $_smarty_tpl->tpl_vars['key']->value;?>
：<?php echo dml($_smarty_tpl->tpl_vars['item']->value,true);?>
；<?php }?>
      <?php } ?>
      </td>
    </tr>
    <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['lang']->value['last_price'];?>
：</td>
      <td class="t_left">
      <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['rs']->value['price']['last']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value){
$_smarty_tpl->tpl_vars['item']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
?>
      <?php if ($_smarty_tpl->tpl_vars['item']->value>0){?><?php echo $_smarty_tpl->tpl_vars['key']->value;?>
：<?php echo dml($_smarty_tpl->tpl_vars['item']->value,true);?>
；<?php }?>
      <?php } ?>
      </td>
    </tr>
    <?php }?>
    <tr><th colspan="2"><?php echo $_smarty_tpl->tpl_vars['lang']->value['propre_title'];?>
</th></tr>
        
<?php if (C("storage_format")>1){?>    
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['lang']->value['storage_1'];?>
：</td>
<td class="t_left"><input name="capability" id="capability" type="text" value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['capability'];?>
" onkeyup="sumBag()" class="spc_input"/>__*__
</td>
</tr>
<?php }?>
<?php if (C("storage_format")==3){?>
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['lang']->value['dozen'];?>
：</td>
<td class="t_left"><input name="dozen" id="dozen" type="text" value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['dozen'];?>
" onkeyup="sumBag()" class="spc_input"/>__*__
</td>
</tr>
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['lang']->value['storage_2'];?>
：</td>
<td class="t_left"><input type="text" name="p_s_3" id="p_s_3" value="" readonly class="spc_input"></td>
</tr>
<?php }?>
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['lang']->value['cube'];?>
：</td>
<td class="t_left">
<?php echo $_smarty_tpl->tpl_vars['lang']->value['long'];?>
<input name="cube_long" id="cube_long" type="text" onkeyup="getToTtalCube(this);"  value="<?php if ($_smarty_tpl->tpl_vars['rs']->value['dml_cube_long']>0){?><?php echo $_smarty_tpl->tpl_vars['rs']->value['dml_cube_long'];?>
<?php }?>"  class="spc_input" style="width:80px!important;"/>M *
<?php echo $_smarty_tpl->tpl_vars['lang']->value['wide'];?>
<input name="cube_wide" id="cube_wide" type="text" onkeyup="getToTtalCube(this);"  value="<?php if ($_smarty_tpl->tpl_vars['rs']->value['dml_cube_wide']>0){?><?php echo $_smarty_tpl->tpl_vars['rs']->value['dml_cube_wide'];?>
<?php }?>"  class="spc_input" style="width:80px!important;"/>M *
<?php echo $_smarty_tpl->tpl_vars['lang']->value['high'];?>
<input name="cube_high" id="cube_high" type="text" onkeyup="getToTtalCube(this);"  value="<?php if ($_smarty_tpl->tpl_vars['rs']->value['dml_cube_high']>0){?><?php echo $_smarty_tpl->tpl_vars['rs']->value['dml_cube_high'];?>
<?php }?>"   class="spc_input" style="width:80px!important;"/>M
=<input name="cube" id="cube" type="text" readonly    value="<?php echo $_smarty_tpl->tpl_vars['rs']->value['dml_cube'];?>
" class="spc_input readonly" style="width:80px!important;"/>M3

</td>
</tr>
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['lang']->value['weight'];?>
：</td>
<td class="t_left"><input name="weight" id="weight" type="text" value="<?php if ($_smarty_tpl->tpl_vars['rs']->value['dml_weight']>0){?><?php echo $_smarty_tpl->tpl_vars['rs']->value['dml_weight'];?>
<?php }?>"  class="spc_input"/> KG
</td>
</tr>


<?php if (C('PRODUCT_COLOR')==1&&C('PRODUCT_SIZE')==1){?>
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['lang']->value['fit'];?>
：</td>
<td class="t_left">
<div class="product_width"><?php echo smarty_function_html_fit(array('class'=>"fit",'value'=>($_smarty_tpl->tpl_vars['rs']->value['fit'])),$_smarty_tpl);?>
</div>
</td>
</tr>
<?php }?>
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['lang']->value['product_pics'];?>
：</td>
<td class="t_left">
<?php echo smarty_function_upload(array('tocken'=>$_smarty_tpl->tpl_vars['file_tocken']->value,'sid'=>$_smarty_tpl->tpl_vars['sid']->value,'type'=>1),$_smarty_tpl);?>

</td>
</tr> 
<?php if ($_smarty_tpl->tpl_vars['rs']->value['pics']){?>
<tr>
<td><?php echo $_smarty_tpl->tpl_vars['lang']->value['product_pics'];?>
：</td>
<td class="t_left"><?php echo smarty_function_showFiles(array('from'=>$_smarty_tpl->tpl_vars['rs']->value['pics'],'delete'=>true),$_smarty_tpl);?>

</td>
</tr>
<?php }?>

<?php if (@LANG_SET=='fr'){?>
<?php $_smarty_tpl->tpl_vars["properties_name"] = new Smarty_variable("properties_name_fr", null, 0);?>
<?php $_smarty_tpl->tpl_vars["pv_name"] = new Smarty_variable("pv_name_fr", null, 0);?>
<?php }else{ ?>
<?php $_smarty_tpl->tpl_vars["properties_name"] = new Smarty_variable("properties_name", null, 0);?>
<?php $_smarty_tpl->tpl_vars["pv_name"] = new Smarty_variable("pv_name", null, 0);?>
<?php }?>
    <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['rs']->value['detail']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value){
$_smarty_tpl->tpl_vars['item']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
?>
    <input type="hidden" name="product_detail[<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
][id]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
">
    <input type="hidden" name="product_detail[<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
][properties_id]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['properties_id'];?>
">
    <tr>
      <td><?php echo $_smarty_tpl->tpl_vars['item']->value[$_smarty_tpl->tpl_vars['properties_name']->value];?>
：</td>
      <td class="t_left">
      <?php if ($_smarty_tpl->tpl_vars['item']->value['properties_type']==1){?>
      <input type="text" name="product_detail[<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
][value]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['value'];?>
" class="spc_input">
      <?php }elseif($_smarty_tpl->tpl_vars['item']->value['properties_type']==2){?>
      <?php echo smarty_function_select(array('combobox'=>"1",'name'=>"product_detail[".($_smarty_tpl->tpl_vars['key']->value)."][value]",'value'=>($_smarty_tpl->tpl_vars['item']->value['value']),'table'=>"properties_value",'key'=>"id",'field'=>$_smarty_tpl->tpl_vars['pv_name']->value,'where'=>"id in(select properties_value_id from properties_info where properties_id=".($_smarty_tpl->tpl_vars['item']->value['properties_id']).") and to_hide=1",'empty'=>true),$_smarty_tpl);?>

      <?php }elseif($_smarty_tpl->tpl_vars['item']->value['properties_type']==3){?>
      <?php echo smarty_function_checkbox(array('name'=>"product_detail[".($_smarty_tpl->tpl_vars['key']->value)."][value][]",'value'=>($_smarty_tpl->tpl_vars['item']->value['value']),'table'=>"properties_value",'key'=>"id",'field'=>$_smarty_tpl->tpl_vars['pv_name']->value,'where'=>"id in(select properties_value_id from properties_info where properties_id=".($_smarty_tpl->tpl_vars['item']->value['properties_id']).") and to_hide=1"),$_smarty_tpl);?>

      <?php }?>
      </td>
    </tr>
    <?php } ?>
     <tr>
      <td valign="top"><?php echo $_smarty_tpl->tpl_vars['lang']->value['comments'];?>
：</td>
      <td class="t_left"><textarea name="comments"><?php echo $_smarty_tpl->tpl_vars['rs']->value['edit_comments'];?>
</textarea>
      </td>
    </tr>
    </tbody>
  </table> 
  </div>
</form>
<?php }} ?>